package at.exam;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.GridView;
import android.widget.TextView;

public class Activity2 extends Activity{

	String[] giaiThuong = new String[]
			{
		"Giải đặc biệt:", "Giải nhất:", "Giải nhì:", "Giải ba:", "Giải tư:", "Giải năm:",
		"Giải sáu:", "Giải bẩy:", "Giải tám:"
			};
	@Override
	public void onCreate (Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity2_layout);
		TextView receiveValueEdit = (TextView) findViewById(R.id.textView1);
		Bundle receiveBundle = this.getIntent().getExtras();
		String receiveValue = receiveBundle.getString("value");
		receiveValueEdit.setText(String.valueOf(receiveValue));
		Intent i = new Intent(Activity2.this, Receiver.class);
		i.putExtra("value", receiveValue);
		sendBroadcast(i);
		GridView gridView = (GridView) findViewById(R.id.gridView1);
		ArrayAdapter<String> adapter = new ArrayAdapter<String> (this, android.R.layout.simple_list_item_1, giaiThuong);
		gridView.setAdapter(adapter);
		gridView.setOnItemSelectedListener(new OnItemSelectedListener() {
			@Override
			public void onItemSelected(AdapterView<?> arg0, View arg1,
					int arg2, long arg3) {
				// TODO Auto-generated method stub
				
			}

			@Override
			public void onNothingSelected(AdapterView<?> arg0) {
				// TODO Auto-generated method stub
				
			}
		});
	}
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
